Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/mail/5) "New Mailing" - Previews should not schedule real blasts #11904

Merged
merged 1 commit into from
Mar 31, 2018

Conversation

totten
Copy link
Member

@totten totten commented Mar 30, 2018

Overview

In CRM_Mailing_BAO_Mailing::create and Mailing.create API, there is a
(ahem) special behavior where setting the scheduled_date will
immediately trigger scheduling. One shouldn't submit scheduled_date for a
preview.

See: https://lab.civicrm.org/dev/mail/issues/5

Before

If one tentatively sets a delivery time and previews, then it prematurely schedules a MailingJob.

After

If one tentatively sets a delivery time and previews, then it does not prematurely schedule a MailingJob.

Technical Details

This was not symptomatic before #11142/v4.7.31 because all preview
operations were wrapped in a transaction and rolled back. But now previews
are allowed to have side-effects, so we need some other means to prevent.

This copies the workaround from crmMailingMgr.save() and applies
it to crmMailingMgr.preview() (etal).

In `CRM_Mailing_BAO_Mailing::create` and `Mailing.create` API, there is a
(*ahem*) special behavior where setting the `scheduled_date` will
immediately trigger scheduling.  One shouldn't submit `scheduled_date` for a
preview.

This was not symptomatic before civicrm#11142/v4.7.31 because all preview
operations were wrapped in a transaction and rolled back.  But now previews
are allowed to have side-effects, so we need some other means to prevent.

This copies the workaround from `crmMailingMgr.save()` and applies
it to `crmMailingMgr.preview()` (etal).
Copy link
Contributor

@seamuslee001 seamuslee001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look sensible and agree with the changes

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@monishdeb
Copy link
Member

Straightforward change as - delete schedule date at the time of estimating recipient, on preview request.

@monishdeb monishdeb merged commit 569281b into civicrm:5.0 Mar 31, 2018
@totten totten deleted the 5.0-preview-regr branch April 14, 2018 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants